<template>
    <el-drawer
        v-model="isShow"
        size="40%"
        :destroy-on-close="true"
        @close="closeHandle"
        :show-close="false"
    >
    <!-- :direction="'ltr'"   在左侧打开 -->
        <template #header="{ close, titleId, titleClass }">
            <h4 :id="titleId" :class="titleClass">{{ title }}</h4>
        </template>
        <el-form :model="form" label-width="auto" label-position="right" ref="formRef" v-loading="loading">
            <el-row :gutter="20">
                <el-col :span="12">
                    <el-form-item label="时间">
                        <el-input v-model="form.name" readonly="true"/>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="单位">
                        <el-input v-model="form.Tel" readonly="true"/>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="接待人">
                        <el-input v-model="form.idcard"  readonly="true"/>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="答复形式">
                        <el-input v-model="form.danwei" readonly="true"/>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="级别">
                        <el-input v-model="form.address" readonly="true"/>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                   
                </el-col>
                <el-col :span="12">
                    <el-form-item label="反映事项">
                        <el-input
                            v-model="form.ReflectionMatters"
                            :rows="6"
                            type="textarea"
                            :autosize="false"
                            resize="none"
                            placeholder=""
                            readonly="true"
                        />
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="处理情况">
                        <el-input
                            v-model="form.HandlingSituation"
                            :rows="6"
                            type="textarea"
                            :autosize="false"
                            resize="none"
                            placeholder=""
                            readonly="true"
                        />
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <template #footer>
            <el-button @click="isShow = false">关闭</el-button>
        </template>
    </el-drawer>
</template>

<script setup>
import {getCurrentInstance} from "vue";
const {proxy} = getCurrentInstance()

const {nj_anjian_type,nj_anjian_status } = proxy.useDict('nj_anjian_type','nj_anjian_status')

// 是否显示抽屉
const isShow = ref(false)
const loading = ref(false)

// 抽屉标题
const title = ref('')

const form = ref({
    name:'2024-12-12',
})
// 通知事件
const emit = defineEmits(['getList'])

const changeShowStatus = () => {
    isShow.value = !isShow.value
}

onMounted(() => {

})

const showEditCase = async (data) => {
    title.value = '来访历史详情'
    changeShowStatus()
}

defineExpose({showEditCase})

// 关闭后的回调事件
const closeHandle = () => {
    console.log(123123)
    emit('getList','123')
}
</script>

<style lang="scss" scoped>
h4{margin:0;}
.el-divider--horizontal{margin:0}
:deep().el-descriptions__label{width:15%}
:deep().el-descriptions__content{width:35%}
</style>